import os
import sys
import json
def backup(config):
	'''main function'''
	print (config)
	return True
	return False

def loadJsonFromFile(filename = ".config"):
	'''load JSON from file and return data from it'''
	with open(filename, 'r', encoding='utf-8') as f:
		try:
			entry = json.load(f)
		except:
			print ("config err")
			sys.exit(2);
	return entry

if __name__ == '__main__':
	config = loadJsonFromFile(".config")
	print("load config:")
	# print(config)
	# print(loadJsonFromFile.__doc__)
	if (backup(config)):
		print ('end of backup')
		sys.exit(0);
	else:
		print ('backup crashed')
		sys.exit(1)